package com.fang.controller;

import com.fang.common.wrapper.ResponseWrapper;
import com.fang.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author Fang Ruichuan
 * @date 2022-08-27 21:54
 */
@RestController
@Api(value = "健康自测",tags = "健康自测")
public class TestController {

    @Autowired
    private SysUserService sysUserService;

    @PreAuthorize("hasRole('admin')")
    @GetMapping("/test")
    @ApiOperation(value = "平台健康测试")
    public ResponseWrapper test() {
        return ResponseWrapper.success(sysUserService.list());
    }
}
